<template>
	<div class="header">
		<van-icon name="arrow-left" class="icon" @click="toother" />
		<div>{{ title }}</div>
	</div>
</template>

<script>
import { Toast } from 'vant'

export default {
	props: ['title'],
	methods: {
		toother() {
			if (!this.$router.back()) {
				Toast('请先登录')
			} else {
				this.$router.back()
			}
		},
	},
}
</script>

<style lang="less" scoped>
.header {
	background-color: #fff;
	height: 40px;
	font-size: 20px;
	display: flex;
	justify-content: center;
	align-items: center;
	border-buttom: 1px solid #d7d7d7;
	.edit {
		font-size: 16px;
		position: absolute;
		right: 15px;
		font-weight: normal;
	}
	.icon {
		position: absolute;
		left: 10px;
	}
}
</style>
